...: ax.set_ylim([0.0,0.2])

     ...: #ax.set_xlim(1)

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.set_xticks(np.arange(0,len(s2)+1,len(s2)/5))

     ...: ax.set_xticklabels(range(0,51,10))

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...:

<matplotlib.figure.Figure at 0x4a357400>


I

n [342]: np.arange(0,len(s2)+1,len(s2)/5)

Out[342]: array([ 0, 10, 20, 30, 40, 50])


In [343]: plt.figure()

     ...: s1.T.plot(legend=False,alpha=0.1,label=[])

     ...: s2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...:

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([0.0,0.2])

     ...: #ax.set_xlim(1)

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: #ax.set_xticks(np.arange(0,len(s2)+1,len(s2)/5))

     ...: #ax.set_xticklabels(range(0,51,10))

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x419466a0>


In [343]:



In [344]: plt.figure()

     ...: s1.T.plot(legend=False,alpha=0.1,label=[])

     ...: s2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...:

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([0.0,0.2])

     ...: #ax.set_xlim(1)

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: #ax.set_xticks(np.arange(0,len(s2)+1,len(s2)/5))

     ...: #ax.set_xticklabels(range(0,51,10))

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...: plt.close()

<matplotlib.figure.Figure at 0x46cd3438>


In [344]:



In [345]: plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.1,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: #ax.set_ylim([0.0,0.2])

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x4d1d4898>


In [346]:

plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.1,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.15,1.25])

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x4844f2e8>



In [347]: plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.1,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.15,1.30])

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...:

<matplotlib.figure.Figure at 0x44abe240>


In [348]:

plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.3,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.15,1.40])

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...:

<matplotlib.figure.Figure at 0x4852d6d8>



In [349]: plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.3,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.15,1.30])

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x43338e10>



In [350]: plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.3,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.18,1.30])

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x3e371ba8>



In [351]: m1.columns=colnames

     ...: s1.columns=colnames

     ...:

     ...: s1.T.plot(legend=False)

     ...: m2=m1.mean(0)

     ...: s2=s1.mean(0)



In [352]: plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.3,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.18,1.30])

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...:

<matplotlib.figure.Figure at 0x43364c88>


In [353]:

plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.3,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x447e6898>


In [354]:

plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.3,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x420c80b8>


In [355]:

plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.3,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: #ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x4583bd68>


I

n [356]: plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.3,label=[],linewidth=2)

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: #ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...:

<matplotlib.figure.Figure at 0x48453b38>


In [357]:

plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.5,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: #ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x48453470>


In [358]:

plt.figure()

     ...: #m1.T.plot(legend=False,alpha=0.5,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()



In [359]: plt.figure()

     ...: s1.T.plot(legend=False,alpha=0.1,label=[])

     ...: s2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...:

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([0.0,1])

     ...: #ax.set_xlim(1)

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: #ax.set_xticks(np.arange(0,len(s2)+1,len(s2)/5))

     ...: #ax.set_xticklabels(range(0,51,10))

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...: plt.close()

     ...:

<matplotlib.figure.Figure at 0x473a0b00>


In [360]:

fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([0.0,6])

     ...: #ax.set_xlim(1)

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: #ax.set_xticks(np.arange(0,len(s2)+1,len(s2)/5))

     ...: #ax.set_xticklabels(range(0,51,10))

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...: plt.close()



In [361]: plt.figure()

     ...: s1.T.plot(legend=False,alpha=0.1,label=[])

     ...: s2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...:

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([0.0,0.6])

     ...: #ax.set_xlim(1)

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: #ax.set_xticks(np.arange(0,len(s2)+1,len(s2)/5))

     ...: #ax.set_xticklabels(range(0,51,10))

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...: plt.close()

<matplotlib.figure.Figure at 0x456f7198>


In [3

62]: plt.figure()

     ...: #m1.T.plot(legend=False,alpha=0.5,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...:



In [363]: plt.figure()

     ...: #m1.T.plot(legend=False,alpha=0.5,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: #ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()



In [364]: plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.5,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: #ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x473856a0>


In [364]:



In [365]: 2015-2005

Out[365]: 10


In [366]: year_range

Out[366]: [2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]


In [367]: 2011-2005

Out[367]: 6


In [368]: ind=range(0,370)

     ...: num=len(ind)

     ...: b=vod.drop('gridID',axis=1)

     ...: b=b.iloc[ind,:]

     ...: mew=pd.DataFrame()

     ...: std=pd.DataFrame()

     ...: for i in range(0,52*7):

     ...: c=b.iloc[:,range(i*7,(i+1)*7)]

     ...: m=c.mean(1)

     ...: s=c.std(1)

     ...: mew=pd.concat([mew,m],axis=1)

     ...: std=pd.concat([std,s],axis=1)

     ...:

     ...:

     ...:

     ...: week=np.array(range(0,7*52,52))

     ...: m1=pd.DataFrame()

     ...: s1=pd.DataFrame()

     ...: for i in range(0,52):

     ...: m=mew.iloc[:,week+i].mean(1)

     ...: s=mew.iloc[:,week+i].std(1)

     ...: s.rename(columns='%f'%i)

     ...: m1=pd.concat([m1,m],axis=1)

     ...: s1=pd.concat([s1,s],axis=1)

     ...:

     ...:

     ...: colnames=[]

     ...: for i in range(0,52):

     ...: colnames.append('%d'%i)

     ...:

     ...:

     ...: m1.columns=colnames

     ...: s1.columns=colnames

     ...:

     ...: s1.T.plot(legend=False)

     ...: m2=m1.mean(0)

     ...: s2=s1.mean(0)


In [369]:

plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.5,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: #ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...:

<matplotlib.figure.Figure at 0x4a36bcf8>


In [369]:



In [370]: np.shape(m1

     ...: )

Out[370]: (370, 52)


In [371]: np.shape(m2)

Out[371]: (52L,)


In [372]: plt.figure()

     ...: m1.T.plot(legend=False,alpha=0.5,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: #ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year (2005 - 2011)',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

<matplotlib.figure.Figure at 0x4a310f60>


In [373]:

plt.figure()

     ...: #m1.T.plot(legend=False,alpha=0.5,label=[])

     ...: m2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([1.21,1.28])

     ...: ax.set_ylabel(r'$\mu(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\mu(VOD)$ Vs Week of Year (2005 - 2011)',fontsize=fs)

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()



In [374]: plt.figure()

     ...: s1.T.plot(legend=False,alpha=0.1,label=[])

     ...: s2.plot(legend=False,linewidth=3,color='m',label='Mean')

     ...:

     ...: fs=15

     ...: ax=plt.gca()

     ...: ax.set_xlabel('Week of Year',fontsize=fs)

     ...: ax.set_ylim([0.0,0.6])

     ...: #ax.set_xlim(1)

     ...: ax.set_ylabel(r'$\sigma(VOD)$',fontsize=fs)

     ...: ax.set_title(r'$\sigma(VOD)$ Vs Week of Year',fontsize=fs)

     ...: #ax.set_xticks(np.arange(0,len(s2)+1,len(s2)/5))

     ...: #ax.set_xticklabels(range(0,51,10))

     ...: ax.grid(color='grey', linestyle='-', linewidth=0.2)

     ...: plt.show()

     ...: plt.close()

<matplotlib.figure.Figure at 0x43208f28>


In [374]:



In [375]: np.shape(s1)

Out[375]: (370, 52)


In [376]: np.shape(s2)

Out[376]: (52L,)


In [377]: